/**
 *
 * 组件JS
 *
 * **/



//快讯组件
var quickComponent = {
    data:function(){    return {}   },
    methods:{
        //跳转货币详情
        goBlockProfile:function(event){
            var id = event.currentTarget.getAttribute('value'); //币种ID
            var symbol = event.currentTarget.getAttribute('symbol');
            window.open("currencyProfile.html?id="+id+'&content='+symbol);
        },
        //显示共享框
        toShare:showShare,
        //根据类型选择对应的分享方式
        toShareType:shareType,
        //鼠标移出关闭共享框
        closeShare: closeShare,
        //利好利空设置
        setUpDown:function(event){
            if(isUpdate){
                isUpdate = false;
                var id = event.currentTarget.getAttribute('value'); //文章ID
                var type = event.currentTarget.getAttribute('type');  //利好 0    利空 1
                var index = event.currentTarget.getAttribute('index'); //数组索引
                var key = event.currentTarget.getAttribute('datekey'); //对应的那个日期
                //更新利好利空
                updateUpDown({url:'zan' ,infoType:'1' , flag:type,id: id,element: this.quickBlock[key][index],currEvent: event.currentTarget});
            }
        },
    },
    props:['ke','val','index','quickBlock'],
    template:'<div class="news-box-group" ref="child">\n' +
        '                            <div class="quick-create-date" v-if="ke == \'today\'">今天</div>\n' +
        '                            <div class="quick-create-date"  v-else>{{ke}}</div>\n' +
        '                            <template v-for="(item,index) in val ">\n' +
        '                                <div class="news-item">\n' +
        '                                    <div class="point"></div>\n' +
        '                                    <div class="time">{{ item.time }}</div>\n' +
        '                                    <!--<div class="title">{{ item.title }}</div>-->\n' +
        '                                    <!--<div class="news">{{ item.content }}</div>-->\n' +
        '                                    <div class="quickBox">\n' +
        '                                        <div class="title" v-html="item.title"></div>\n' +
        '                                        <div class="news" v-html="item.content"></div>\n' +
        '                                        <div class="status" v-if="item.blocks.length !=0"><span class="pointer"  v-for="b in item.blocks" :class="{\'down-active\': !b.isUp}" :symbol="b.symbol"  :value="b.id" @click="goBlockProfile">{{ b.name }}</span></div>\n' +
        '                                        <div class="use">\n' +
        '                                            <span >来源：{{ item.source }}</span>\n' +
        '                                            <div class="share-type hidden" @mouseLeave.native="closeShare">\n' +
        '                                                <div class="share-type-item"  @click="toShareType(0,$event)" :value="item.id"><img src="image/fuzhi.png">复制</div>\n' +
        '                                                <div class="share-type-item"  @click="toShareType(1,$event)" :value="item.id"><img src="image/weibo.png">新浪微博</div>\n' +
        '                                                <div class="share-type-item"  @click="toShareType(3,$event)" :value="item.id"><img src="image/qq.png">QQ分享</div>\n' +
        '                                                <div class="share-type-item"  @click="toShareType(2,$event)" :value="item.id"><img src="image/weixin.png">微信分享</div>\n' +
        '                                                <div class="code"></div>\n' +
        '                                                <div class="down"></div>\n' +
        '                                            </div>\n' +
        '                                            <span class="share share-btn pointer" @click="toShare"  :value="item.id" infotype="1"><img src="image/fenxiang.png">分享</span>\n' +
        '                                            <span class="share use-li" @click="setUpDown" :value="item.id" :datekey="ke" :index="index" type="1"><span class="flag">+1</span><img :src="item.badImg" >利空({{item.bad}}) </span>\n' +
        '                                            <span class="share use-li" @click="setUpDown" :value="item.id" :datekey="ke" :index="index" type="0"><span class="flag">+1</span><img :src="item.goodImg" >利好({{item.good}}) </span>\n' +
        '                                        </div>\n' +
        '                                        <div class="clearfix"></div>\n' +
        '                                    </div>\n' +
        '                                    <div class="clearfix"></div>\n' +
        '                                </div>\n' +
        '                            </template>\n' +
        '                        </div>',
};


//精选资讯组件
var siftComponent = {
    data:function(){    return {}   },
    methods:{
        goBlockProfile:function(event){
            var id = event.currentTarget.getAttribute('value');
            // window.open("currencyProfile.html?id="+id);
            var symbol = event.currentTarget.getAttribute('symbol');
            window.open("currencyProfile.html?id="+id+'&content='+symbol);
        },
        toShare:showShare,
        //根据类型选择对应的分享方式
        toShareType:shareType,
        //鼠标移出关闭共享框
        closeShare: closeShare,
        //文章详情
        goNewsText: function(event){
            var id = event.currentTarget.getAttribute('value');
            // location.href = 'newsText.html?id='+id+'&type=1';
            window.open('newsText.html?id='+id+'&type=4');
        },
        //点击头像调用 个人主页
        goPersonalMain: function(event){
            var type =  $('#information-list .nav-active').attr('value');
            var id = event.currentTarget.getAttribute('value');
            // location.href="personalMain.html?id="+id;
            window.open("personalMain.html?id="+id+'&type=4');
        },
        //利好利空
        setUpDown:function(event){
            if(isUpdate){
                isUpdate = false;
                var id = event.currentTarget.getAttribute('value'); //文章ID
                var type = event.currentTarget.getAttribute('type');  //利好 0    利空 1
                var index = event.currentTarget.getAttribute('index'); //数组索引
                //更新利好利空
                updateUpDown({url:'zan' ,infoType:'4' , flag:type,id: id,element: this.siftBlock[index],currEvent: event.currentTarget});
            }
        },
    },
    props:['item','index','siftBlock'],
    template:'                      <div class="news-item">\n' +
        '                                <div class="news-img hidden-xs" @click="goNewsText" :value="item.id"><img v-if="item.img" :src="item.img"><img v-else src="image/news.png"></div>\n' +
        '                                <!--<div class="title" @click="goNewsText" :value="item.id">{{ item.title }}</div>-->\n' +
        '                                <!--<div class="news" @click="goNewsText" :value="item.id">{{ item.content }}</div>-->\n' +
        '                                <div class="title font-hover-blue" @click="goNewsText" :value="item.id" v-html="item.title"></div>\n' +
        '                                <div class="news" @click="goNewsText" :value="item.id" v-html="item.content"></div>\n' +
        '                                <div class="status"><span class="pointer" v-for="b in item.blocks" :class="{\'down-active\': !b.isUp}"  :symbol="b.symbol" :value="b.id" @click="goBlockProfile">{{ b.name }}</span></div>\n' +
        '                                <div class="use">\n' +
        '                                    <span :value="item.userId" @click="goPersonalMain"  :title="item.usernameFull" class="font-hover-blue"><img class="header-img" :src="item.userImg" v-cloak="">{{ item.username }}</span>\n' +
        '                                    <span>{{ item.time }}</span>\n' +
        '                                    <span>浏览数({{ item.seeNum }})</span>\n' +
        '                                    <div class="share-type hidden"  @mouseLeave="closeShare">\n' +
        '                                        <div class="share-type-item"  @click="toShareType(0,$event)" :value="item.id"><img src="image/fuzhi.png">复制</div>\n' +
        '                                        <div class="share-type-item"  @click="toShareType(1,$event)" :value="item.id"><img src="image/weibo.png">新浪微博</div>\n' +
        '                                        <div class="share-type-item"  @click="toShareType(3,$event)" :value="item.id"><img src="image/qq.png">QQ分享</div>\n' +
        '                                        <div class="share-type-item"  @click="toShareType(2,$event)" :value="item.id"><img src="image/weixin.png">微信分享</div>\n' +
        '                                        <!--<div class="code"><img src="image/code.png" width="110px" height="110px"></div>-->\n' +
        '                                        <div class="code"></div>\n' +
        '                                        <div class="down"></div>\n' +
        '                                    </div>\n' +
        '                                    <span class="share share-btn pointer" @click="toShare"   :value="item.id" infotype="4"><img src="image/fenxiang.png">分享</span>\n' +
        '                                    <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="1"><span class="flag">+1</span><img :src="item.badImg" >利空({{item.bad}}) </span>\n' +
        '                                    <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="0"><span class="flag">+1</span><img :src="item.goodImg" >利好({{item.good}}) </span>\n' +
        '                                </div>\n' +
        '                            </div>',
};

//twitter组件
var twitterComponent = {
    data:function(){    return {}   },
    methods:{
        goBlockProfile:function(event){
            var id = event.currentTarget.getAttribute('value');
            // window.open("currencyProfile.html?id="+id);
            var symbol = event.currentTarget.getAttribute('symbol');
            window.open("currencyProfile.html?id="+id+'&content='+symbol);
        },
        toShare:showShare,
        //根据类型选择对应的分享方式
        toShareType:shareType,
        //鼠标移出关闭共享框
        closeShare: closeShare,
        //点击头像调用 个人主页
        goPersonalMain: function(event){
            var type =  $('#information-list .nav-active').attr('value');
            var id = event.currentTarget.getAttribute('value');
            // location.href="personalMain.html?id="+id;
            window.open("personalMain.html?id="+id+'&type=3');
        },
        //利好利空
        setUpDown:function(event){
            if(isUpdate){
                isUpdate = false;
                var id = event.currentTarget.getAttribute('value'); //文章ID
                var type = event.currentTarget.getAttribute('type');  //利好 0    利空 1
                var index = event.currentTarget.getAttribute('index'); //数组索引
                //更新利好利空
                console.log(this);
                updateUpDown({url:'zan' ,infoType:'3' , flag:type,id: id,element: this.twitterBlock[index],currEvent: event.currentTarget});
            }
        },
    },
    props:['item','index','twitterBlock'],
    template:'                      <div class="news-item">\n' +
        '                                <div class="news-img"><img class="pointer" :src="item.userImg" :value="item.userId" @click="goPersonalMain" v-cloak="" onerror="imgLoadError()"></div>\n' +
        '                                <div class="news-content">\n' +
        '                                    <div class="title pointer font-hover-blue"  :value="item.userId" @click="goPersonalMain">{{ item.username }}</div>\n' +
        '                                    <!--<div class="news" v-html="item.enContent"></div>-->\n' +
        '                                    <div class="news" v-html="item.enContent"></div>\n' +
        '                                    <div class="en-title" :class="{hidden: !item.isTrans }">Google 翻译</div>\n' +
        '                                    <!--<div class="news" v-html="item.cnContent"></div>-->\n' +
        '                                    <div class="news" v-html="item.cnContent"></div>\n' +
        '                                    <div class="status" v-if="item.blocks.length !=0"><span class="pointer" v-for="b in item.blocks" :class="{\'down-active\': !b.isUp}"  :symbol="b.symbol" :value="b.id" @click="goBlockProfile">{{ b.name }}</span></div>\n' +
        '                                    <div class="use">\n' +
        '                                        <span>{{ item.time }}</span>\n' +
        '                                        <!--<span>{{ item.time }}</span>-->\n' +
        '                                        <!--<span>浏览数({{ item.seeNum }})</span>-->\n' +
        '                                        <div class="share-type hidden"  @mouseLeave="closeShare">\n' +
        '                                            <div class="share-type-item"  @click="toShareType(0,$event)" :value="item.id"><img src="image/fuzhi.png">复制</div>\n' +
        '                                            <div class="share-type-item"  @click="toShareType(1,$event)" :value="item.id"><img src="image/weibo.png">新浪微博</div>\n' +
        '                                            <div class="share-type-item"  @click="toShareType(3,$event)" :value="item.id"><img src="image/qq.png">QQ分享</div>\n' +
        '                                            <div class="share-type-item"  @click="toShareType(2,$event)" :value="item.id"><img src="image/weixin.png">微信分享</div>\n' +
        '                                            <!--<div class="code"><img src="image/code.png" width="110px" height="110px"></div>-->\n' +
        '                                            <div class="code"></div>\n' +
        '                                            <div class="down"></div>\n' +
        '                                        </div>\n' +
        '                                        <span class="share share-btn pointer" @click="toShare"  :value="item.id" infotype="3"><img src="image/fenxiang.png">分享</span>\n' +
        '                                        <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="1"><span class="flag">+1</span><img :src="item.badImg" >利空({{item.bad}}) </span>\n' +
        '                                        <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="0"><span class="flag">+1</span><img :src="item.goodImg" >利好({{item.good}}) </span>\n' +
        '                                    </div>\n' +
        '                                </div>\n' +
        '                                <div class="clearfix"></div>\n' +
        '                            </div>',
};

//微博组件
var blogComponent = {
    data:function(){    return {}   },
    methods:{
        goBlockProfile:function(event){
            var id = event.currentTarget.getAttribute('value');
            // window.open("currencyProfile.html?id="+id);
            var symbol = event.currentTarget.getAttribute('symbol');
            window.open("currencyProfile.html?id="+id+'&content='+symbol);
        },
        toShare:showShare,
        //根据类型选择对应的分享方式
        toShareType:shareType,
        //鼠标移出关闭共享框
        closeShare: closeShare,
        //点击头像调用 个人主页
        goPersonalMain: function(event){
            var type =  $('#information-list .nav-active').attr('value');
            var id = event.currentTarget.getAttribute('value');
            // location.href="personalMain.html?id="+id;
            window.open("personalMain.html?id="+id+'&type=2');
        },
        //利好利空
        setUpDown:function(event){
            if(isUpdate){
                isUpdate = false;
                var id = event.currentTarget.getAttribute('value'); //文章ID
                var type = event.currentTarget.getAttribute('type');  //利好 0    利空 1
                var index = event.currentTarget.getAttribute('index'); //数组索引
                //更新利好利空
                updateUpDown({url:'zan' ,infoType:'2' , flag:type,id: id,element: this.blogBlock[index],currEvent: event.currentTarget});
            }
        },
        //浏览大图
        toLargeImg: showLargeImg,
    },
    props:['item','index','largeImg','blogBlock'],
    template:'                      <div class="news-item">\n' +
        '                                <div class="news-img"><img class="pointer" :src="item.userImg" :value="item.userId" @click="goPersonalMain" onerror="imgLoadError()" ></div>\n' +
        '                                <div class="news-content">\n' +
        '                                    <div class="title pointer font-hover-blue" :value="item.userId" @click="goPersonalMain">{{ item.username }}</div>\n' +
        '                                    <!--<div class="news" v-html="item.content"></div>-->\n' +
        '                                    <div class="news" v-html="item.content"></div>\n' +
        '                                    <div class="content-img">\n' +
        '                                        <div class="content-img-item" v-for="(url,imgIndex) in item.urls" @click="toLargeImg(index,imgIndex,$event)">\n' +
        '                                            <img class="pointer" :src="url" :width="item.urlsGeo[imgIndex].width" :height="item.urlsGeo[imgIndex].height" :style="{marginTop:item.urlsGeo[imgIndex].top,marginLeft:item.urlsGeo[imgIndex].left}">\n' +
        '                                        </div>\n' +
        '                                        <div class="clearfix"></div>\n' +
        '                                    </div>\n' +
        '                                    <div class="status" v-if="item.blocks.length !=0"><span class="pointer" v-for="b in item.blocks" :class="{\'down-active\': !b.isUp}"  :symbol="b.symbol" :value="b.id" @click="goBlockProfile">{{ b.name }}</span></div>\n' +
        '                                    <div class="use">\n' +
        '                                        <span><img class="header-img" src="image/sina.png">微博www.weibo.com</span>\n' +
        '                                        <span>{{ item.time }}</span>\n' +
        '                                        <!--<span>浏览数({{ item.seeNum }})</span>-->\n' +
        '                                        <div class="share-type hidden"  @mouseLeave="closeShare">\n' +
        '                                            <div class="share-type-item"  @click="toShareType(0,$event)" :value="item.id"><img src="image/fuzhi.png">复制</div>\n' +
        '                                            <div class="share-type-item"  @click="toShareType(1,$event)" :value="item.id"><img src="image/weibo.png">新浪微博</div>\n' +
        '                                            <div class="share-type-item"  @click="toShareType(3,$event)" :value="item.id"><img src="image/qq.png">QQ分享</div>\n' +
        '                                            <div class="share-type-item"  @click="toShareType(2,$event)" :value="item.id"><img src="image/weixin.png">微信分享</div>\n' +
        '                                            <!--<div class="code"><img src="image/code.png" width="110px" height="110px"></div>-->\n' +
        '                                            <div class="code" ></div>\n' +
        '                                            <div class="down"></div>\n' +
        '                                        </div>\n' +
        '                                        <span class="share share-btn pointer" @click="toShare" :value="item.id" infotype="2"><img src="image/fenxiang.png">分享</span>\n' +
        '                                        <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="1"><span class="flag">+1</span><img :src="item.badImg" >利空({{item.bad}}) </span>\n' +
        '                                        <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="0"><span class="flag">+1</span><img :src="item.goodImg" >利好({{item.good}}) </span>\n' +
        '                                    </div>\n' +
        '                                </div>\n' +
        '                                <div class="clearfix"></div>\n' +
        '                            </div>',
};

//技术分析组件
var skillComponent = {
    data:function(){    return {}   },
    methods:{
        goBlockProfile:function(event){
            var id = event.currentTarget.getAttribute('value');
            // window.open("currencyProfile.html?id="+id);
            var symbol = event.currentTarget.getAttribute('symbol');
            window.open("currencyProfile.html?id="+id+'&content='+symbol);
        },
        goNewsText: function(event){
            var id = event.currentTarget.getAttribute('value');
            // location.href = 'newsText.html?id='+id+'&type=2';
            window.open('newsText.html?id='+id+'&type=5');
        },
        //点击头像调用 个人主页
        goPersonalMain: function(event){
            var type =  $('#information-list .nav-active').attr('value');
            var id = event.currentTarget.getAttribute('value');
            // location.href="personalMain.html?id="+id;
            window.open("personalMain.html?id="+id+'&type=5');
        },
        toShare:showShare,
        //根据类型选择对应的分享方式
        toShareType:shareType,
        //鼠标移出关闭共享框
        closeShare: closeShare,
        //利好利空
        setUpDown:function(event){
            if(isUpdate){
                isUpdate = false;
                var id = event.currentTarget.getAttribute('value'); //文章ID
                var type = event.currentTarget.getAttribute('type');  //利好 0    利空 1
                var index = event.currentTarget.getAttribute('index'); //数组索引
                //更新利好利空
                updateUpDown({url:'zan' ,infoType:'5' , flag:type,id: id,element: this.skillBlock[index],currEvent: event.currentTarget});
            }
        },
    },
    props:['item','index','skillBlock'],
    template:'                      <div class="news-item">\n' +
        '                                <div class="news-img hidden-xs"  @click="goNewsText" :value="item.id"><img v-if="item.img"  :src="item.img"><img v-else src="image/news.png"></div>\n' +
        '                                <!--<div class="title"  @click="goNewsText" :value="item.id">{{ item.title }}</div>-->\n' +
        '                                <!--<div class="news"  @click="goNewsText" :value="item.id">{{ item.content }}</div>-->\n' +
        '                                <div class="title font-hover-blue" @click="goNewsText" :value="item.id" v-html="item.title"></div>\n' +
        '                                <div class="news" @click="goNewsText" :value="item.id" v-html="item.content"></div>\n' +
        '                                <div class="status"><span class="pointer" v-for="b in item.blocks":class="{\'down-active\': !b.isUp}"  :symbol="b.symbol" :value="b.id"  @click="goBlockProfile">{{ b.name }}</span></div>\n' +
        '                                <div class="use">\n' +
        '                                    <span :value="item.userId" @click="goPersonalMain" :title="item.usernameFull" class="font-hover-blue"><img class="header-img" :src="item.userImg" v-cloak="">{{ item.username }}</span>\n' +
        '                                    <span>{{ item.time }}</span>\n' +
        '                                    <span>浏览数({{ item.seeNum }})</span>\n' +
        '                                    <div class="share-type hidden"  @mouseLeave="closeShare">\n' +
        '                                        <div class="share-type-item"  @click="toShareType(0,$event)" :value="item.id"><img src="image/fuzhi.png">复制</div>\n' +
        '                                        <div class="share-type-item"  @click="toShareType(1,$event)" :value="item.id"><img src="image/weibo.png">新浪微博</div>\n' +
        '                                        <div class="share-type-item"  @click="toShareType(3,$event)" :value="item.id"><img src="image/qq.png">QQ分享</div>\n' +
        '                                        <div class="share-type-item"  @click="toShareType(2,$event)" :value="item.id"><img src="image/weixin.png">微信分享</div>\n' +
        '                                        <!--<div class="code"><img src="image/code.png" width="110px" height="110px"></div>-->\n' +
        '                                        <div class="code" ></div>\n' +
        '                                        <div class="down"></div>\n' +
        '                                    </div>\n' +
        '                                    <span class="share share-btn pointer" @click="toShare" :value="item.id" infotype="5"><img src="image/fenxiang.png">分享</span>\n' +
        '                                    <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="1"><span class="flag">+1</span><img :src="item.badImg" >利空({{item.bad}}) </span>\n' +
        '                                    <span class="share use-li" @click="setUpDown" :value="item.id" :index="index" type="0"><span class="flag">+1</span><img :src="item.goodImg" >利好({{item.good}}) </span>\n' +
        '                                </div>\n' +
        '                            </div>',
};



// 右侧交易公告
var noticeComponent = {
    data:function(){ return {
        pageSize: 10, //公告
        pageNum: 1, //公告
    };},
    methods:{
        //交易所公告详情
        goNoticeText: function(event){
            var id = event.currentTarget.getAttribute('value');
            // location.href = 'bourseNoticeText.html?id='+id;
            window.open('bourseNoticeText.html?id='+id);
        },
    },
    props:['noticeBlock'],
    template:'<div class="hide-scroll">\n' +
        '\t\t\t\t\t\t\t\t\t<div class="show-scroll">\n' +
        '\t\t\t\t\t\t\t\t\t\t<div class="notice-item"  v-for="item in noticeBlock">\n' +
        '\t\t\t\t\t\t\t\t\t\t\t<span class="zuhe  font-hover-blue"  @click="goNoticeText" :value="item.id">【{{ item.from }}】\n' +
        '\t\t\t\t\t\t\t\t\t\t\t\t<span class="title pointer"  >{{ item.title }}</span>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t</span>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t<div class="time">{{ item.time }}</div>\n' +
        '\t\t\t\t\t\t\t\t\t\t</div>\n' +
        '\t\t\t\t\t\t\t\t\t</div>\n' +
        '\t\t\t\t\t\t\t\t</div>',

};
// 右侧交易公告(包括标题，且单TAB)
var noticeFullComponent = {
    data:function(){ return {
        pageSize: 10, //公告
        pageNum: 1, //公告
        noticeBlock: [],
    };},
    methods:{
        //公告详情
        goBourseNotice: function(){
            // location.href="bourseNotice.html";
            window.open("bourseNotice.html");
        },
        //交易所公告详情
        goNoticeText: function(event){
            var id = event.currentTarget.getAttribute('value');
            // location.href = 'bourseNoticeText.html?id='+id;
            window.open('bourseNoticeText.html?id='+id);
        },
    },
    // props:['noticeBlock'],
    mounted:function(){
        // 查询交易所公告
        getBourList({pageSize:this.pageSize,pageNum :this.pageNum, element: this});
    },
    template:'          <div class="notice-box box">\n' +
        '                    <div class="single-title">交易所公告<span class="right-more"  @click="goBourseNotice">更多<img src="image/jinruBlue.png" ></span></div>\n' +
        '                    <div class="single-content">\n' +
        '                        <div class="hide-scroll">\n' +
        '                            <div class="show-scroll">\n' +
        '                                <div class="notice-item"  v-for="item in noticeBlock">\n' +
        '                                    <span class="zuhe  font-hover-blue" @click="goNoticeText" :value="item.id">【{{ item.from }}】\n' +
        '                                            <span class="title pointer"  >{{ item.title }}</span>\n' +
        '                                        </span>\n' +
        '                                    <div class="time">{{ item.time }}</div>\n' +
        '                                </div>\n' +
        '                            </div>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                </div>',

};


//右侧涨跌榜
var upDownComponent ={
    data:function(){ return {
        // proBlock:[],
    };},
    methods:{
        //币种详情
        goCurrencyProfile:function(event){
            var id = event.currentTarget.getAttribute('value');
            var symbol = event.currentTarget.getAttribute('symbol');
            location.href = 'currencyProfile.html?id='+id+'&content='+symbol;
        },
        // //涨跌切换
        // changeUpDown:function(event){
        //     //  0 涨    1 跌
        //     $('.btn-change').removeClass('btn-active');
        //     $(event.currentTarget).addClass('btn-active');
        //     var btnValue = $(event.currentTarget).attr('value');
        //     // var currValue = $(event.currentTarget).parent().parent().find('li.active').eq(0).attr('value');
        //     this.valueType = btnValue;
        //     // 查询涨跌幅榜
        //     var data = {
        //         timeType : '1d',
        //         valueType : this.valueType,
        //         element: this,
        //     };
        //     getSummaryChange(data);
        //
        // },
    },
    props:['proBlock'],
    template:'<table class="table text-center">\n' +
        '\t\t\t\t\t\t\t\t\t<thead>\n' +
        '\t\t\t\t\t\t\t\t\t\t<tr class="t-head">\n' +
        '\t\t\t\t\t\t\t\t\t\t\t<td class="text-center" colspan="2">名称</td>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t<td width="33%">价格</td>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t<td width="33%">涨跌幅</td>\n' +
        '\t\t\t\t\t\t\t\t\t\t</tr>\n' +
        '\t\t\t\t\t\t\t\t\t</thead>\n' +
        '\t\t\t\t\t\t\t\t\t<tbody class="t-body">\n' +
        '\t\t\t\t\t\t\t\t\t\t\t<tr class="pointer bg-hover-blue"  v-for="(item,index) in proBlock" v-cloak="" :symbol="item.name" :value="item.id" @click="goCurrencyProfile">\n' +
        '\t\t\t\t\t\t\t\t\t\t\t\t<td><span class=" t-id">{{ index+1 }}</span></td>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t\t<td class="t-code">{{ item.name }}</td>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t\t<td class="t-val" width="33%">{{ item.usd }}</td>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t\t<td class="t-stat" :class="{\'font-down\':!item.isUp,\'font-up\':item.isUp}" width="33%">{{ item.num}}</td>\n' +
        '\t\t\t\t\t\t\t\t\t\t\t</tr>\n' +
        '\t\t\t\t\t\t\t\t\t</tbody>\n' +
        '\t\t\t\t\t\t\t\t</table>',
};
//右侧涨跌榜(包括标题的，且单TAB)
var upDownFullComponent ={
    data:function(){
        return {
            pageSize: 10, //公告
            pageNum: 1, //公告
            valueType: 0 , //涨跌标志 0 涨   1跌
            directionType: 1, //资金流向  0 流入 1 流出
            timeType: '1d', //
            downImg: 'image/xiala.png',
            proBlock:[],
        };
    },
    methods:{
        //币种详情
        goCurrencyProfile:function(event){
            var id = event.currentTarget.getAttribute('value');
            var symbol = event.currentTarget.getAttribute('symbol');
            location.href = 'currencyProfile.html?id='+id+'&content='+symbol;
        },
        //涨跌按钮切换
        changeUpDown:function(event){
            //  0 涨    1 跌
            $('.btn-change').removeClass('btn-active');
            $(event.currentTarget).addClass('btn-active');
            var btnValue = $(event.currentTarget).attr('value');
            // var currValue = $(event.currentTarget).parent().parent().find('li.active').eq(0).attr('value');
            this.valueType = btnValue;
            // 查询涨跌幅榜
            var data = {
                timeType : '1d',
                valueType : this.valueType,
                element: this,
            };
            getSummaryChange(data);
        },
        //右侧涨幅榜和流入榜下方三角箭头的切换
        toNextPage: function(){
            var obj = $('.ranking-box .single-content');
            if(obj.attr('value')=='0'){
                obj.attr('value',1).animate({height:600},500);
                this.downImg = 'image/shangla.png';
            }else{
                obj.attr('value',0).animate({height:330},500);
                this.downImg = 'image/xiala.png';
            }
        },
    },
    // props:['proBlock'],
    mounted: function(){
        // 查询涨跌幅榜   24H涨跌幅  0涨   1跌
        getSummaryChange({timeType: '1d',valueType:0, element: this});   //	timeType时间类型	是	String :	1h 1小时   1d 1天    7d 7天    30d 30天
    },
    template:'           <div class="ranking-box box">\n' +
        '                    <div class="single-title">\n' +
        '                        24H涨跌榜\n' +
        '                        <span class="right-more">\n' +
        '                            <div  class="more btn-group">\n' +
        '                                <button class="btn btn-xs btn-active btn-change" value="0" @click="changeUpDown">涨</button>\n' +
        '                                <button class="btn btn-xs btn-change" value="1"  @click="changeUpDown">跌</button>\n' +
        '                            </div>\n' +
        '                        </span>\n' +
        '                    </div>\n' +
        '                    <div class="single-content" value="0">\n' +
        '                        <table class="table text-center">\n' +
        '                            <thead>\n' +
        '                            <tr class="t-head">\n' +
        '                                <td class="text-center" colspan="2">名称</td>\n' +
        '                                <td width="33%">价格</td>\n' +
        '                                <td width="33%">涨跌幅</td>\n' +
        '                            </tr>\n' +
        '                            </thead>\n' +
        '                            <tbody class="t-body">\n' +
        '                                <tr class="bg-hover-blue pointer" v-for="(item,index) in proBlock" :symbol="item.name" :value="item.id" @click="goCurrencyProfile">\n' +
        '                                    <td><div class="t-id">{{ index+1 }}</div></td>\n' +
        '                                    <td class="t-code">{{ item.name }}</td>\n' +
        '                                    <td class="t-val" width="33%">{{ item.usd }}</td>\n' +
        '                                    <td class="t-stat" :class="{\'font-down\':!item.isUp,\'font-up\':item.isUp}" width="33%">{{ item.num}}</td>\n' +
        '                                </tr>\n' +
        '                            </tbody>\n' +
        '                        </table>\n' +
        '                    </div>\n' +
        '                    <!--下箭头-->\n' +
        '                    <div class="down-single"><img class="pointer" :src="downImg" @click="toNextPage"></div>\n' +
        '                </div>',
};

//右侧热门资讯(包括标题)
var hotFullComponent = {
    data:function(){ return {
        hotBlock:[ ],
    };},
    methods:{
        //交易公告详情
        goHotProfile: function(event){
            var id = event.currentTarget.getAttribute('value');
            window.open('newsText.html?id='+id+'&type=4');
        },
    },
    // props:['hotBlock'],
    mounted:function(){
        //热门文章
        getHotArticles({infoType:1,element:this});
    },
    template: '<div class="hot-box box">\n' +
        '                    <div class="single-title">热门资讯</div>\n' +
        '                    <div class="single-content hot-content">\n' +
        '                        <div class="hide-scroll">\n' +
        '                            <div class="show-scroll">\n' +
        '                                <table class="table table-striped">\n' +
        '                                    <tr v-for="item in hotBlock" class="hot-line-tr">\n' +
        // '                                        <td @click="goHotProfile" :value="item.id" class="hot-num"><div class="btn btn-xs  t-id">{{ item.index }}</div></td>\n' +
        // '                                        <td @click="goHotProfile" :value="item.id" class="t-content pointer font-hover-blue">{{ item.title }}</td>\n' +
        '                                        <td   class="hot-line"  @click="goHotProfile" :value="item.id"><div class="t-id">{{ item.index }}</div><div class="t-content pointer font-hover-blue">{{ item.title }}</div><div class="clearfix"></div><div class="hot-bottom"></div> </td>\n' +
        '                                    </tr>\n' +
        '                                </table>\n' +
        '                            </div>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                </div>',
    // template: '<div class="hot-box box">\n' +
    //     '                    <div class="single-title">热门资讯</div>\n' +
    //     '                    <div class="single-content hot-content">\n' +
    //     '                        <div class="hide-scroll">\n' +
    //     '                            <div class="show-scroll">\n' +
    //     '                                <table class="table table-striped">\n' +
    //     '                                    <tr class="hot-line"  v-for="item in hotBlock">\n' +
    //     '                                        <td class="hot-num"><div class="btn btn-xs btn-primary t-id">{{ item.index }}</div></td>\n' +
    //     '                                        <td class="t-content pointer font-hover-blue" @click="goHotProfile" :value="item.id">{{ item.title }}</td>\n' +
    //     '                                    </tr>\n' +
    //     '                                </table>\n' +
    //     '                            </div>\n' +
    //     '                        </div>\n' +
    //     '                    </div>\n' +
    //     '                </div>',
};


// var largeImgComponent = {
//     data : function(){
//         return {};
//     },
//     props:["imgUrl" ,"index","imgIndex","blogInfo"],
//     methods:{
//         nextImg:function(){
//             var count = this.blogInfo.blogBlock[this.index].largeUrls.length;
//
//             if(parseInt(this.imgIndex)+1 >= count){
//                 this.imgIndex = 0;
//             }else{
//                 this.imgIndex ++;
//             }
//             this.imgUrl = this.blogInfo.blogBlock[this.index].largeUrls[this.imgIndex];
//         },
//         prevImg:function(){
//             var count = this.blogInfo.blogBlock[this.index].largeUrls.length;
//             if(parseInt(this.imgIndex)- 1 < 0){
//                 this.imgIndex = count-1;
//             }else{
//                 this.imgIndex --;
//             }
//             this.imgUrl = this.blogInfo.blogBlock[this.index].largeUrls[this.imgIndex];
//         },
//         btnIn:function(type){
//             switch(parseInt(type)){
//                 case 0:
//                     $('#largeImgModal .right-btn img').attr('src','image/largeRightActive.png');
//                     break;
//                 case 1:
//                     $('#largeImgModal .left-btn img').attr('src','image/largeLeftActive.png');
//                     break;
//                 case 2:
//                     $('#largeImgModal .close img').attr('src','image/largeCloseActive.png');
//                     break;
//             }
//         },
//         btnOut: function(type){
//             switch(parseInt(type)){
//                 case 0:
//                     $('#largeImgModal .right-btn img').attr('src','image/largeRight.png');
//                     break;
//                 case 1:
//                     $('#largeImgModal .left-btn img').attr('src','image/largeLeft.png');
//                     break;
//                 case 2:
//                     $('#largeImgModal .close img').attr('src','image/largeClose.png');
//                     break;
//             }
//         }
//     },
//     template:'<div class="modal-dialog">\n' +
//         '        <div class="modal-content">\n' +
//         '            <div class="modal-body">\n' +
//         '                <button type="button" class="close close-btn" data-dismiss="modal"><img src="image/largeClose.png" @mouseEnter="btnIn(2)" @mouseLeave="btnOut(2)"> </button>\n' +
//         '                <div class="left-btn " @click="prevImg" @mouseEnter="btnIn(1)" @mouseLeave="btnOut(1)"><img src="image/largeLeft.png"></div>\n' +
//         '                <div class="right-btn " @click="nextImg" @mouseEnter="btnIn(0)" @mouseLeave="btnOut(0)"><img src="image/largeRight.png"></div>\n' +
//         '                <img :src="imgUrl" class="curr-img" :index="index">\n' +
//         '                <div class="clearfix"></div>\n' +
//         '            </div>\n' +
//         '        </div>\n' +
//         '    </div>',
// };

